Video signal processing method and apparatus

ABSTRACT

A chrominance adjustment method and apparatus, and a storage medium are provided. The method includes: determining a color adjustment coefficient of a chrominance component of a color signal based on a reference display device maximum luminance value (RML) and/or a source maximum luminance value (SML); and adjusting the chrominance component of the color signal based on the color adjustment coefficient.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of International Application No.PCT/CN2020/115029, filed on Sep. 14, 2020, which claims priority toChinese Patent Application No. 201910999369.0, filed on Oct. 18, 2019.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of display technologies, and inparticular, to a video signal processing method and apparatus.

BACKGROUND

High dynamic range (HDR) is a hotspot technology recently emerging inthe video industry, and is also a future development direction of thevideo industry. Compared with a conventional standard dynamic range(SDR) video signal, an HDR video signal has a larger dynamic range andhigher luminance. However, a large quantity of existing display devicescannot reach luminance of the HDR video signal. Therefore, when the HDRvideo signal is displayed, luminance mapping processing needs to beperformed on the HDR signal based on a capability of the display device,so that the HDR signal can be displayed on the current device. An HDRsignal luminance processing method based on red-green-blue (RGB) spaceis a common method, and is widely applied to actual display devices.

A typical HDR video processing process includes: pre-processing,encoding, decoding, and post-processing. An HDR video is input, andundergoes processing performed by an optical-electro transfer function,color space transfer, floating-point-to-fixed-point conversion,4:4:4-to-4:2:0 downsampling, and encoding performed by a 4:2:0 encoder,and a bitstream is obtained. The bitstream undergoes decoding performedby a 4:2:0 decoder, 4:2:0-to-4:4:4 upsampling,fixed-point-to-floating-point conversion, color space transfer, andprocessing performed by an electro-optical transfer function, and afinally output HDR video is obtained. A transfer function is used toperform non-linear transfer on an HDR source. The HDR video finallyneeds to be quantized to data that has an integral quantity of bits, andthen is encoded. Considering that a dynamic range of the HDR video isfar greater than a dynamic range of the data that has an integralquantity of bits, if linear quantization is directly performed,information of the HDR source is severely damaged. Therefore, thetransfer function is mainly used to protect, through the non-lineartransfer, a brightness segment that requires key protection.

A color signal is an optical signal in the real world, and may berepresented by “L” or “E”, usually records a value corresponding to acolor component (for example, R, G, B, or Y), and is usually directlyproportional to light intensity. A primary color signal of the picturemay be expressed in real brightness (for example, 10000 nits), or may beexpressed in normalized brightness, for example, based on that maximumbrightness 10000 nits is normalized to maximum brightness 1. Processedpicture information obtained after the primary color signal undergoesconversion processing is a numeric expression value of the picture, anda value of the processed picture information is normalized to [0,1]. Thepicture information may be represented by “L′” or “E′”, which is usuallyused to indicate a nonlinear color value. Optical-electro transfer isperformed on the primary color signal (normalized to [0,1]) by using theoptical-electro transfer function, to obtain processed pictureinformation. The processed picture information obtained through thetransfer performed by the optical-electro transfer function may includeprimary colors such as R, G, B, and Y. Electro-optical transfer isperformed on input picture information by using the electro-opticaltransfer function, to obtain an output primary color signal. Theprocessed output primary color signal is a restored optical signal inthe real world. The optical-electro transfer function (OETF) issometimes referred to as an optical-electro transfer function or anoptical-electro transfer curve. The electro-optical transfer function(EOTF) is sometimes referred to as an electro-optical transfer functionor an electro-optical transfer curve. The optical-electro transfer curveand the electro-optical transfer curve for dynamic range adjustment mayalso be referred to as tone-mapping (tone-mapping) curves. Thefloating-point-to-fixed-point conversion is sometimes referred to asquantization, and the fixed-point-to-floating-point conversion issometimes referred to as dequantization. An optical-electro transferfunction in a conventional technology is provided based on a luminanceperception model of human eyes. The optical-electro transfer functionmay be:

$\begin{matrix}{{R^{\prime} = {{PQ\_ TF}\left( {\max\left( {0,{\min\left( {{\text{R}\text{/10000}},1} \right)}} \right)} \right)}}{G^{\prime} = {{PQ\_ TF}\left( {\max\left( {0,{\min\left( {{\text{G}\text{/10000}},1} \right)}} \right)} \right)}}{B^{\prime} = {{PQ\_ TF}\left( {\max\left( {0,{\min\left( {{\text{B}\text{/10000}},1} \right)}} \right)} \right)}}{{{PQ\_ TF}(L)} = \left( \frac{c_{1} + {c_{2}L^{m_{1}}}}{1 + {c_{3}L^{m_{1}}}} \right)^{m_{2}}},{{{where}\mspace{14mu} m_{1}} = {0.1593017578125}},{m_{2} = 78.84375},{c_{1} = {{0.8}359375}},{c_{2} = 18.8515625},{{{and}\mspace{14mu} c_{3}} = {1{8.6}875.}}} & \;\end{matrix}$

A tone-mapping process from a high dynamic range to a low dynamicprocess causes a change to local luminance of a picture/video. Thechange of the local luminance causes changes to saturation and colortemperature in visual perception of human eyes, and consequently, avisual difference of the picture/video before and after the tone-mappingprocess is caused.

SUMMARY

This application provides a video signal processing method andapparatus, for resolving a problem of a visual difference that is beforeand after a tone-mapping process and that is caused by tone-mapping.

According to a first aspect of embodiments of this application, asaturation adjustment method is provided, including: determining asaturation adjustment factor of one color component of a color signalbased on at least one saturation adjustment parameter, where thesaturation adjustment parameter includes: a reference display devicemaximum luminance value (RML), a source maximum luminance value (SML), atarget display device maximum luminance value (TML), and a saturationadjustment strength (SatR); and adjusting the color component based on amaximum value of a plurality of color components of the color signal andthe saturation adjustment factor of the color component.

Compared with the conventional technology, when saturation adjustment isperformed on one color signal in a to-be-processed color signal, othercomponents of the signal are considered at the same time. An associationbetween different components is considered, to improve an effect ofsaturation adjustment.

In one embodiment, the color signal is an RGB signal, and the adjustingthe color component based on a maximum value of a plurality of colorcomponents of the color signal and the saturation adjustment factor ofthe color component includes: adjusting one of R, G, and B componentsbased on a maximum value of the red (R), green (G), and blue (B)components in the RGB signal and the saturation adjustment factorcorresponding to one of the R, G, and B components.

It should be understood that, the method in this embodiment of thisapplication may also be used in another color space, for example, YCbCrspace or YUV space.

In one embodiment, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix},} \right.$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

In one embodiment, when saturation adjustment is performed on one colorcomponent in the to-be-processed color signal, impact of the maximumvalue of the plurality of different components on saturation adjustmentof the current component is considered at the same time, to improve aprocessing effect.

In one embodiment, the method further includes: adjusting the R, G, andB components based on a first correction strength factor; and

correspondingly, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C\; 1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix},} \right.$

where

C1 is the first correction strength factor.

By introducing the correction strength factor, accuracy of saturationadjustment is further improved, and an effect of saturation adjustmentis improved.

In one embodiment, the first correction strength factor is obtainedbased on decoded metadata, or is calculated based on information carriedin the metadata.

In one embodiment, the color signal is a to-be-displayed signal afterdynamic range adjustment is performed.

In one embodiment, the saturation adjustment factor is obtained based onthe following formula:

$W_{N} = \left\{ {\begin{matrix}{{{{SatR} + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {R\; M\; L}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)}},}\ } & {N_{in} \geq {R\; M\; L}} \\{{\frac{{SatR} \times \left( {N_{in} - {R\; M\; L}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)},}\ } & {{R\; M\; L} > N_{in} \geq {T\; M\; L}} \\{{0,}\ } & {other}\end{matrix},} \right.$

where

N_(in) is one of R_(in), G_(in), B_(in), and W_(N) is the saturationadjustment factor corresponding to the color component represented byN_(in).

A proper saturation adjustment factor is determined based on an actualto-be-processed color signal and characteristics of a display device. Itshould be understood that, there may be a plurality of saturationadjustment factor determining methods. This is not limited in thisembodiment of this application.

In one embodiment, at least one of the reference display device maximumluminance value, the source maximum luminance value, and the saturationadjustment strength is determined based on a preset value, or at leastone of the reference display device maximum luminance value, the sourcemaximum luminance value, and the saturation adjustment strength isdetermined based on the decoded metadata.

In one embodiment, the saturation adjustment strength is 0.8.

In one embodiment, the target display device maximum luminance value isobtained based on a parameter of a target display device.

In one embodiment, when the color signal is a non-RGB signal, before thedetermining a saturation adjustment factor of one color component of acolor signal based on at least one saturation adjustment parameter, themethod further includes: converting the non-RGB signal into an RGBsignal and using the RGB signal as the color signal.

When this embodiment of this application is directly applied to a signalof another color space, a signal of the another color space mayalternatively be converted into an RGB signal for processing.

According to a second aspect of the embodiments of this application, asaturation adjustment apparatus is provided, including: a calculationmodule, configured to determine a saturation adjustment factor of onecolor component of a color signal based on at least one saturationadjustment parameter, where the saturation parameter includes: areference display device maximum luminance value (RML), a source maximumluminance value (SML), a target display device maximum luminance value(TML), and a saturation adjustment strength (SatR); and a conversionmodule, configured to adjust the color component based on a maximumvalue of a plurality of color components of the color signal and thesaturation adjustment factor of the color component.

In one embodiment, the color signal is an RGB signal, and the conversionmodule is configured to: adjust one of R, G, and B components based on amaximum value of the red (R), green (G), and blue (B) components in theRGB signal and the saturation adjustment factor corresponding to one ofthe R, G, and B components.

In one embodiment, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix},} \right.$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

In one embodiment, the conversion module is further configured to:adjust the R, G, and B components based on a first correction strengthfactor; and correspondingly, the R, G, and B components are adjustedbased on the following formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C\; 1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix},} \right.$

where

C1 is the first correction strength factor.

In one embodiment, the first correction strength factor is obtainedbased on decoded metadata, or is calculated based on information carriedin the metadata.

In one embodiment, the color signal is a to-be-displayed signal afterdynamic range adjustment is performed.

In one embodiment, the saturation adjustment factor is obtained based onthe following formula:

$W_{N} = \left\{ {\begin{matrix}{{{{SatR} + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)}},}\ } & {N_{in} \geq {R\; M\; L}} \\{{\frac{{SatR} \times \left( {N_{in} - {R\; M\; L}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)},}\ } & {{R\; M\; L} > N_{in} \geq {T\; M\; L}} \\{{0,}\ } & {other}\end{matrix},} \right.$

where

N_(in) is one of R_(in), G_(in), B_(in), and W_(N) is the saturationadjustment factor corresponding to the color component represented byN_(in).

In one embodiment, at least one of the reference display device maximumluminance value, the source maximum luminance value, and the saturationadjustment strength is determined based on a preset value, or at leastone of the reference display device maximum luminance value, the sourcemaximum luminance value, and the saturation adjustment strength isdetermined based on the decoded metadata.

In one embodiment, the saturation adjustment strength is 0.8.

In one embodiment, the target display device maximum luminance value isobtained based on a parameter of a target display device.

In one embodiment, when the color signal is a non-RGB signal, thecalculation module is further configured to: convert the non-RGB signalinto an RGB signal and use the RGB signal as the color signal.

According to a third aspect of the embodiments of this application, achrominance adjustment method is provided, including: determining acolor adjustment coefficient of a chrominance component of a colorsignal based on a reference display device maximum luminance value (RML)and/or a source maximum luminance value (SML); and adjusting thechrominance component of the color signal based on the color adjustmentcoefficient.

In this embodiment of this application, the color adjustment coefficientof the color signal is determined based on characteristics of areference display device and/or a signal source, so that a betterchrominance component adjustment effect can be achieved.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

For example, the foregoing formula may be

$S = \left\{ \begin{matrix}{{B - {C\; 2 \times {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{R\; M\; L} - {A \times R\; M\; L}} \right)}}},} & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{B - {C\; 2 \times {SatR}\; 1}},} & {Y_{in} \geq {R\; M\; L}}\end{matrix} \right.$

For example, the foregoing formula may be simplified as:

$S = \left\{ {\begin{matrix}{{{1 - {C\; 2 \times {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times R\; M\; L}} \right)}{\left( {{R\; M\; L} - {A \times R\; M\; L}} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{1 - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$

where

SatR1 is 0.8 or 0.7.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times R\; M\; L}} \right)}{\left( {{R\; M\; L} - {A \times R\; M\; L}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{\begin{matrix}{B - {C\; 2 \times {SatR}\; 1} - {C\; 2 \times}} \\{{{SatR}\; 2 \times {g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)} \right)}},}\end{matrix}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$

where

g(x) is a monotonically increasing function when x is in an interval 0to 1, and SatR2 is a second saturation adjustment coefficient.

In one embodiment, at least one of RML, SML, A, B, C2, SatR1, and SatR2is obtained based on decoded metadata, or is calculated based oninformation carried in the metadata.

In one embodiment, the reference display device maximum luminance valueand/or the source maximum luminance value are/is determined based on apreset value, or determined based on the decoded metadata.

In one embodiment, A is a preset value, and 0<A≤1. For example, A may be0.1, 0.3, ⅓, 0.4, 0.5, 0.6, ⅔, 0.7, 0.8, or 0.9.

In one embodiment, B is a preset value, and 0<B≤1. For example, B may be0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, B is determined based on the source maximum luminancevalue and a target display device maximum luminance value (TML).

In one embodiment, B is a ratio of SML to TML.

In one embodiment, SatR1 and SatR2 are preset values, 0<SatR1≤1, and0<SatR2≤1. For example, SatR1 and SatR2 may be 0.3, 0.4, 0.5, 0.6, 0.7,0.8, or 0.9.

In one embodiment, SatR1+SatR2≤1.

In one embodiment, f(x)=x.

In one embodiment, g(x)=x.

In one embodiment, f(x)=x^(N), and N>0.

In one embodiment, g(x)=x^(M), and M>0.

In one embodiment, g(x)=const, and const is a constant. For example,const may be 0, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, the chrominance component is adjusted based on thefollowing formulas:

C_(b)^(′) = C_(b) ⋅ S;  and C_(r)^(′) = C_(r) ⋅ S,

where

C_(b), C_(r) are chrominance components before the color signal isadjusted, and C_(b)′, C_(r)′ are chrominance components after the colorsignal is adjusted.

According to a fourth aspect of the embodiments of this application, achrominance adjustment apparatus is provided, including: a calculationmodule, configured to determine a color adjustment coefficient of achrominance component of a color signal based on a reference displaydevice maximum luminance value (RML) and/or a source maximum luminancevalue (SML); and a conversion module, configured to adjust thechrominance component of the color signal based on the color adjustmentcoefficient.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times R\; M\; L}} \right)}{\left( {{R\; M\; L} - {A \times R\; M\; L}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

For example, the foregoing formula may be:

$S = \left\{ {{\begin{matrix}{{B - {C\; 2 \times {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)}}},} & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{B - {C\; 2 \times {SatR}\; 1}},} & {Y_{in} \geq {RML}}\end{matrix}S} = \left\{ \begin{matrix}{{1 - {C2 \times \ {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)}}},} & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{1 - {C2 \times SatRl}},} & {Y_{in} \geq {RML}}\end{matrix} \right.} \right.$

For example, the foregoing formula may be simplified as:

where SatR1 is 0.8 or 0.7.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times R\; M\; L}} \right)}{\left( {{R\; M\; L} - {A \times R\; M\; L}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{\begin{matrix}{B - {C\; 2 \times {SatR}\; 1} - {C\; 2 \times}} \\{{{SatR}\; 2 \times {g\left( \frac{\left( {Y_{in} - {R\; M\; L}} \right)}{\left( {{S\; M\; L} - {R\; M\; L}} \right)} \right)}},}\end{matrix}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$

where

g(x) is a monotonically increasing function when x is in an interval 0to 1, and SatR2 is a second saturation adjustment coefficient.

In one embodiment, at least one of RML, SML, A, B, C2, SatR1, and SatR2is obtained based on decoded metadata, or is calculated based oninformation carried in the metadata.

In one embodiment, the reference display device maximum luminance valueand/or the source maximum luminance value are/is determined based on apreset value, or determined based on the decoded metadata.

In one embodiment, A is a preset value, and 0<A≤1. For example, A may be0.1, 0.3, ⅓, 0.4, 0.5, 0.6, ⅔, 0.7, 0.8, or 0.9.

In one embodiment, B is a preset value, and 0<B≤1. For example, B may be0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, B is determined based on the source maximum luminancevalue and a target display device maximum luminance value (TML).

In one embodiment, B is a ratio of SML to TML.

In one embodiment, SatR1 and SatR2 are preset values, 0<SatR1≤1, and0<SatR2≤1. For example, SatR1 and SatR2 may be 0.3, 0.4, 0.5, 0.6, 0.7,0.8, or 0.9.

In one embodiment, SatR1+SatR2≤1.

In one embodiment, f(x)=x.

In one embodiment, g(x)=x.

In one embodiment, f(x)=x^(N), and N>0.

In one embodiment, g(x)=x^(M), and M>0.

In one embodiment, g(x)=const, and const is a constant. For example,const may be 0, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, the chrominance component is adjusted based on thefollowing formulas:

C_(b)^(′) = C_(b) ⋅ S;  and C_(r)^(′) = C_(r) ⋅ S,

where

C_(b), C_(r) are chrominance components before the color signal isadjusted, and C_(b)′, C_(r)′ are chrominance components after the colorsignal is adjusted.

According to a fifth aspect of the embodiments of this application, apicture processing device is provided, including: a non-volatile memoryand a processor that are coupled to each other, where the processorinvokes program code stored in the memory, to perform the methodaccording to the first aspect or the third aspect.

According to a sixth aspect of the embodiments of this application, acomputer-readable storage medium is provided. The computer-readablestorage medium stores a computer program. When the computer program isrun on a processor, the method in the first aspect or the third aspectis implemented.

According to a seventh aspect of the embodiments of this application, avideo signal processing apparatus is provided. The apparatus includes aprocessor and a memory. The memory is configured to store necessaryinstructions and data, and the processor invokes the instructions in thememory to implement the method in the first aspect or the third aspect.

According to an eighth aspect of the embodiments of this application, acomputer program product is provided, including a computer program. Whenthe computer program is executed on a computer or a processor, thecomputer or the processor is enabled to implement the method in thefirst aspect or the third aspect.

It should be understood that, the technical solutions of the second, andfourth to eighth aspects of this application are consistent with thetechnical solutions of the first and third aspects of this application.Beneficial effects obtained in the feasible implementations are similar.Details are not described again.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1-a is a schematic diagram of an example of a PQ EOTF curveaccording to an embodiment of this application;

FIG. 1-b is a schematic diagram of an example of a PQ EOTF⁻¹ curveaccording to an embodiment of this application;

FIG. 2-a is a schematic diagram of an example of an HLG OETF curveaccording to an embodiment of this application;

FIG. 2-b is a schematic diagram of an example of an HLG OETF⁻¹ curveaccording to an embodiment of this application;

FIG. 3-a is a schematic diagram of an architecture of an example of avideo signal processing system according to an embodiment of thisapplication;

FIG. 3-b is a schematic diagram of an architecture of an example ofanother video signal processing system according to an embodiment ofthis application;

FIG. 3-c is a schematic diagram of a structure of an example of a videosignal processing apparatus according to an embodiment of thisapplication;

FIG. 4 is a schematic diagram of a system architecture to which picturesignal conversion is applied according to an embodiment of thisapplication;

FIG. 5 is a schematic flowchart of an example of a video signalprocessing method according to an embodiment of this application;

FIG. 6 is a schematic flowchart of an example of another video signalprocessing method according to an embodiment of this application;

FIG. 7 is a schematic diagram of a structure of an example of a videosignal processing apparatus according to an embodiment of thisapplication;

FIG. 8 is a schematic flowchart of an example of still another videosignal processing method according to an embodiment of this application;

FIG. 9 is a schematic diagram of a structure of an example of anothervideo signal processing apparatus according to an embodiment of thisapplication; and

FIG. 10 is a schematic diagram of a structure of an example of stillanother video signal processing apparatus according to an embodiment ofthis application.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of thisapplication clearer, the following further describes this application indetail with reference to the accompanying drawings

The term “at least one” in this application means one or more, namely,including one, two, three, or more, and the term “a plurality of” meanstwo or more, namely, including two, three, or more.

For ease of understanding of embodiments of this application, someconcepts or terms in embodiments of this application are firstdescribed.

A color value is a value corresponding to a particular color component(for example, R, G, B, or Y) of a picture.

A digital code value is a digital expression value of a picture signal,and the digital code value is used to represent a nonlinear color value.

A linear color value is in direct proportion to light intensity, needsto be normalized to [0, 1] in an optional case, and is abbreviated as E.

A nonlinear color value is a normalized digital expression value ofpicture information, is in direct proportion to a digital code value,needs to be normalized to [0, 1] in an optional case, and is abbreviatedas E′.

An electro-optical transfer function (EOTF) describes a relationship ofconversion from a nonlinear color value to a linear color value.

An optical-electro transfer function (OETF) describes a relationship ofconversion from a linear color value to a nonlinear color value.

Metadata is data that is carried in a video signal and that describesvideo source information.

Dynamic metadata is metadata associated with each frame of picture, andthe metadata changes with pictures.

Static metadata is metadata associated with a picture sequence, and themetadata remains unchanged in the picture sequence.

A luminance signal (luma) represents a combination of nonlinear primarycolor signals, and has a symbol of Y′.

Luminance mapping is mapping from luminance of a source picture toluminance of a target system.

Display adaptation is to process a video signal to adapt to a displayproperty of a target display.

A source picture is a picture that is input in an HDR pre-processingstage.

A mastering display is a reference display used when a video signal isedited and produced, and is used to determine editing and producingeffects of a video.

A linear scene light signal is an HDR video signal using content asscene light in an HDR video technology, is scene light captured by acamera/lens sensor, and is generally a relative value. HLG coding isperformed on the linear scene light signal to obtain an HLG signal. TheHLG signal is a scene light signal. The HLG signal is nonlinear. Thescene light signal generally needs to be converted into a display lightsignal through OOTF, to be displayed on a display device.

A linear display light signal is an HDR video signal using content asdisplay light in an HDR video technology, is display light emitted by adisplay device, and is generally an absolute value in a unit of nit. PQcoding is performed on the linear display light signal to obtain a PQsignal, the PQ signal is a display light signal, and the PQ signal is anonlinear signal. The display light signal is generally displayed on thedisplay device based on absolute luminance thereof.

An opto-optical transfer curve (OOTF) is a curve used to convert onelight signal into another light signal in a video technology.

A dynamic range is a ratio of highest luminance to lowest luminance of avideo signal.

Luma-chroma-chroma (LCC) is three components of a video signal in whichluminance and chrominance are separated.

A perceptual quantizer (PQ) is an HDR standard, and is also an HDRconversion equation. The PQ is determined based on a visual capabilityof a person. A video signal displayed on a display device is generally avideo signal in a PQ coding format.

A PQ EOTF curve is used to convert, into a linear light signal, anelectrical signal on which PQ coding has been performed, and a unit isnit. A conversion formula is:

${{PQ\_ EOTF}\left( E^{\prime} \right)} = {10000{\left( \frac{\max\left\lbrack {\left( {{E^{\prime}}^{1/m_{2}} - c_{1}} \right),0} \right\rbrack}{c_{2} - {c_{3}{E^{\prime}}^{1/m_{2}}}} \right)^{1/m_{1}}.}}$

E′ is an input electrical signal, and has a value range of [0, 1], andfixed parameter values are:

m1 = 2610/16384 = 0.1593017578125; m 2 = 2523/4096 × 128 = 78.84375;c 1 = 3424/4096 = 0.8359375 = c 3 − c 2 + 1;c 2 = 2413/4096 × 32 = 18.8515625;  and  c 3 = 2392/4096 × 32 = 18.6875.

The PQ EOTF curve is shown in FIG. 1-a: An input is an electrical signalin a range [0, 1], and an output is a linear optical signal with [0,10000] nits.

A PQ EOTF⁻¹ curve is an inverse curve of the PQ EOTF curve, and aphysical meaning of the PQ EOTF⁻¹ curve is to convert the linear opticalsignal with [0, 10000] nits into an electrical signal on which PQ codingis performed; and a conversion formula is:

${{PQ\_ EOTF}^{- 1}(E)} = {\left( \frac{c_{1} + {c_{2}\left( {{E/1}0000} \right)}^{m_{1}}}{1 + {c_{3}\left( {{E/1}0000} \right)}^{m_{1}}} \right)^{m_{2}}.}$

The PQ EOTF⁻¹ curve is shown in FIG. 1-b: An input is a linear opticalsignal with [0, 10000] nits, and an output is an electrical signal in arange [0, 1].

A color gamut is a color range included in color space, and relatedcolor gamut standards include BT.709 and BT.2020.

Hybrid log gamma (HLG) is an HDR standard. A video signal captured by acamera, a video camera, a picture sensor, or another type of picturecapturing device is a video signal in an HLG coding format.

An HLG OETF curve is a curve used to perform HLG coding on a linearscene light signal to convert the linear scene light signal into anonlinear electrical signal. A conversion formula is:

$E^{\prime} = \left\{ {\begin{matrix}{\sqrt{3*E}\ } & {0 \leq E \leq {{1/1}2}} \\{{a*{\ln\left( {{12*E} - b} \right)}} + c\ } & {{1/12} < E \leq 1}\end{matrix}.} \right.$

E is an input linear scene light signal, and has a range of [0, 1], andE is an output nonlinear electrical signal, and has a range of [0, 1].

Fixed parameters are as follows: a=0.17883277, b=0.28466892,c=0.55991073. FIG. 2-a is a diagram of an example of the HLG OETF curve.

An HLG OETF⁻¹ curve is an inverse curve of the HLG OETF curve, andconverts a nonlinear electrical signal on which HLG coding is performedinto a linear scene optical signal. For example, a conversion formula isas follows:

$E = \left\{ {\begin{matrix}{{E^{\prime 2}/3},} & {0 \leq E^{\prime} \leq {1/2}} \\{{{\left( {{\exp\left( \frac{\left( {E^{\prime} - c} \right)}{a} \right)} + b} \right)/1}2},} & {{1/2} < E^{\prime} \leq 1}\end{matrix}.} \right.$

FIG. 2-b is a diagram of an example of the HLG OETF⁻¹ curve. E is aninput nonlinear electrical signal and has a range of [0, 1]; and E is anoutput linear scene optical signal and has a range of [0, 1].

Linear space in this application is space in which a linear light signalis located.

Nonlinear space in this application is space in which a signal obtainedafter a linear light signal is converted by using a nonlinear curve islocated. Common nonlinear curves of the HDR include the PQ EOTF-1 curve,the HLG OETF curve, and the like, and a common nonlinear curve of theSDR includes a gamma curve. Generally, it is considered that a signalobtained after a linear light signal is coded by using the nonlinearcurve is visually linear relative to human eyes. It should be understoodthat the nonlinear space may be considered as visual linear space.

Gamma correction is a method for performing nonlinear hue editing on apicture. A dark-colored part and a light-colored part in the picturesignal can be detected, and proportions of the dark-colored part and thelight-colored part are increased, to improve a picture contrast effect.Optical-electro transfer features of existing screens, photographicfilms, and many electronic cameras may be nonlinear. A relationshipbetween outputs and inputs of these nonlinear components may berepresented by using a power function, namely: output=(input)^(γ).

Because a visual system of the human being is nonlinear, and the humanbeing perceives a visual stimulation through comparison, nonlinearconversion is performed on a color value output by a device. Stimulationis enhanced by the outside world at a particular proportion, and for thehuman being, such stimulation evenly increases. Therefore, forperception of the human being, a physical quantity increasing in ageometric progression is even. To display input colors based on a visuallaw of the human being, nonlinear conversion in the form of the powerfunction is needed, to convert a linear color value into a nonlinearcolor value. A value y of gamma may be determined based on anoptical-electro transfer curve of color space.

For the color space, colors may be different perceptions of eyes forlight rays having different frequencies, or may represent objectivelyexisting light having different frequencies. The color space is a colorrange defined by a coordinate system that is established by people torepresent colors. Color gamut and a color model define color spacetogether. The color model is an abstract mathematical model thatrepresents a color by using a group of color components. The color modelmay be, for example, a red green blue (RGB) mode and a printing cyanmagenta yellow black (CMYK) mode. The color gamut is a sum of colorsthat can be generated by a system. For example, Adobe RGB and sRGB aredifferent color space based on an RGB model.

Each device such as a display or a printer has color space, and cangenerate colors only in color gamut of the device. When a picture istransferred from one device to another device, because the deviceconverts the picture based on the color space of the device and displaysRGB or CMYK, colors of the picture may change on different devices.

The RGB space in the embodiments of this application is space in which avideo signal is quantitatively represented by luminance of red, green,and blue. YCC space is color space representing separation of luminanceand chrominance in this application. Three components of a YCC-spacevideo signal respectively represent luminance-chrominance-chrominance.Common YCC-space video signals include YUV, YCbCr, ICtCp, and the like.

An embodiment of this application provides a video signal processingmethod and apparatus. A saturation change generated by tone-mappingperformed on a to-be-processed video signal can be compensated for basedon this method, to alleviate a tone shift phenomenon.

The following describes in detail embodiments of this application withreference to the accompanying drawings. First, a video signal processingsystem provided in embodiments of this application is described. Then, avideo signal processing apparatus provided in embodiments of thisapplication is described. Finally, one embodiment of a video signalprocessing method provided in embodiments of this application isdescribed.

As shown in FIG. 3-a, a video signal processing system 100 provided inembodiments of this application may include a signal source 101 and avideo signal processing apparatus 102 that is provided in embodiments ofthis application. The signal source 101 is configured to input ato-be-processed video signal to the video signal processing apparatus102. The video signal processing apparatus 102 is configured to processthe to-be-processed video signal according to the video signalprocessing method provided in embodiments of this application. In anoptional case, the video signal processing apparatus 102 shown in FIG.3-a may have a display function. Then, the video signal processingsystem 100 provided in embodiments of this application may furtherdisplay a video signal on which video signal processing has beenperformed. In this case, the processed video signal does not need to beoutput to a display device. In this case, the video signal processingapparatus 102 may be a display device such as a television or a displayhaving a video signal processing function.

In a structure of another video signal processing system 100 shown inFIG. 3-b, the system 100 further includes a display device 103. Thedisplay device 103 may be a device having a display function such as atelevision or a display, or may be a display. The display device 103 isconfigured to receive a video signal transmitted by the video signalprocessing apparatus 102 and display the received video signal. Thevideo signal processing apparatus 102 herein may be a play device suchas a set top box.

In the foregoing example video signal processing system 100, if theto-be-processed video signal generated by the video signal source 101 isan HDR signal on which no RGB-space luminance mapping is performed, thesignal may be processed by the video signal processing apparatus 102 byusing the video signal processing method provided in embodiments of thisapplication. In this case, the video signal processing apparatus 102 mayhave an RGB-space luminance mapping function for an HDR signal. If theto-be-processed video signal generated by the video signal source 101may be a video signal on which RGB-space luminance mapping has beenperformed, for example, may be a video signal on which the RGB-spaceluminance mapping has been performed and color space conversion tononlinear NTFL1 space has been performed in embodiments of thisapplication, the video signal processing apparatus 102 performs colorsaturation compensation on the signal. In embodiments of thisapplication, the video signal may be converted from YUV space to RGBspace or from RGB space to YUV space by using a standard conversionprocess in the conventional technology.

In one embodiment, the video signal processing apparatus 102 provided inembodiments of this application may be in a structure shown in FIG. 3-c.It can be learned that the video signal processing apparatus 102 mayinclude a processing unit 301. The processing unit 301 may be configuredto implement operations in the video signal processing method providedin embodiments of this application, for example, an operation ofdetermining a saturation adjustment factor corresponding to an initialluminance value of a to-be-processed video signal, and a operation ofadjusting a chrominance value of the to-be-processed video signal basedon the saturation adjustment factor.

For example, the video signal processing apparatus 102 may furtherinclude a storage unit 302. The storage unit 302 stores a computerprogram, instructions, and data. The storage unit 302 may be coupled tothe processing unit 301, and is configured to support the processingunit 301 in invoking the computer program and the instructions in thestorage unit 302, to implement the operations in the video signalprocessing method provided in embodiments of this application. Inaddition, the storage unit 302 may be further configured to store data.In embodiments of this application, coupling is interconnectionimplemented in a particular manner, and includes direct connection orindirect connection implemented by using another device. For example,coupling may be implemented through various interfaces, transmissionlines, or buses.

For example, the video signal processing apparatus 102 may furtherinclude a sending unit 303 and/or a receiving unit 304. The sending unit303 may be configured to output the processed video signal. Thereceiving unit 304 may receive the to-be-processed video signalgenerated by the video signal source 101. For example, the sending unit303 and/or the receiving unit 304 may be a video signal interface suchas a high definition multimedia interface (HDMI).

For example, the video signal processing apparatus 102 may furtherinclude a display unit 305 such as a display, configured to display theprocessed video signal.

FIG. 4 shows an example of a system architecture to which theembodiments of this application are applied. In one embodiment, afront-end device (including a video acquisition and production device)completes production of high dynamic HDR content, and transmits videosource data (picture information) and metadata (dynamic metadata and/orstatic metadata) to a display end by using a transport layer. Based ondisplay capabilities (SDR or HDR) of different display devices, thedisplay end converts the received video source data (in someembodiments, in combination with information provided by the metadata)into a display picture adapted to the display device. It should beunderstood that, “low dynamic” in “low dynamic HDR” and “low dynamicSDR” in FIG. 4 is relative to high dynamic HDR content generated by thefront end. It should be further understood that, in differentembodiments, the display device may have a display capability with ahigher dynamic range than HDR content generated by the front end. Adisplay adaptation process of the display device may also be applied tothis system architecture. This is not limited in this application.

For example, a dynamic range conversion module in the embodiments ofthis application may exist in a set-top box, a television display, amobile terminal display, and a video conversion device such as a networklive broadcast device or a network video application device. In oneembodiment, the module may exist in a form of a chip in the set-top box,the television display, and the mobile terminal display, and may existin a form of a software program in the video conversion device such asthe network live broadcast device or the network video applicationdevice.

FIG. 5 is a schematic flowchart of a picture signal conversionprocessing method according to an embodiment of this application. Thepicture signal conversion processing method in the embodiment shown inFIG. 5 may include at least the following operations.

S501: Receive a bitstream that includes source picture signal data andmetadata.

Usually, both the source picture signal data (an HDR video signal) andthe metadata are transmitted in a form of the bitstream. The bitstreamis obtained by encoding picture data and auxiliary information at avideo content production end, and is restored to the source picturesignal data and the metadata with loss or losslessly through decoding ata display end. The source picture signal data may be pixel data, and themetadata may include a format of video source data and variousparameters related to HDR video processing, for example, parameters in adynamic range conversion model.

It should be understood that, a format of the source picture signal datais not limited in this embodiment of this application. For example, thesource picture signal data may be data in YUV color space, or may bedata in RGB color space, or may be data of 8 bits, or may be data of 10bits, or data of 12 bits.

It should be further understood that, in this embodiment of thisapplication, a format of the metadata is not limited. For example, themetadata may be standard ST2094-40 including histogram information andtone-mapping curve parameter information, or may be standard ST2094-10including the tone-mapping curve parameter information. The metadata maybe dynamic metadata, or may be static metadata, or include both staticmetadata and dynamic metadata,

In this embodiment of this application, the received source picturesignal data may be an optical signal, or may be an electrical signal.This is not limited in this application.

S502: Perform, based on a preset dynamic range conversion model, dynamicrange conversion (tone-mapping) on a color signal obtained by decodingthe bitstream, to adapt to a display device.

In this embodiment of this application, a dynamic range conversion modeland a corresponding tone-mapping processing method in the conventionaltechnology may be applied. This is not limited. For example, the dynamicrange conversion model, which may also be referred to as a dynamic rangeconversion function, a dynamic range conversion curve, anoptical-electro conversion function, or the like, may be:

$\begin{matrix}{{L^{\prime} = {{F(L)} = {{a \times \left( \frac{p \times L^{n}}{{\left( {{k_{1} \times p} - k_{2}} \right) \times L^{n}} + k_{3}} \right)^{m}} + b}}},} & \end{matrix}$

where

L is a color value of a color component of the to-be-processed colorsignal, L′ is a color value of the processed color component, that is,the to-be-displayed color signal, k₁, k₂, k₃, a, b, m, n, and p aremodel parameters.

S503: Adjust color saturation of the color signal obtained after dynamicrange conversion is performed.

One embodiment is described in detail with reference to FIG. 6.

S504: Display, on the display device, the color signal obtained aftercolor saturation adjustment is performed.

It should be understood that, after the color signal after colorsaturation adjustment is performed is obtained and before display, oneor more picture processing processes such as color gamut conversion,noise reduction processing, and sharpening processing may be furtherperformed on the color signal obtained after color saturation adjustmentis performed. This is not limited in this application.

FIG. 6 is a schematic flowchart of another picture signal conversionprocessing method according to an embodiment of this application. Theembodiment shown in FIG. 6 describes one embodiment of operation S503 inFIG. 5, and may include at least the following operations.

S601: Determine a saturation adjustment parameter.

In this embodiment of this application, the saturation adjustmentparameter is used to determine a saturation adjustment factor. Forexample, the saturation adjustment parameter includes: a referencedisplay device maximum luminance value, a source maximum luminancevalue, a target display device maximum luminance value, and a saturationadjustment strength. Manners of determining the saturation adjustmentparameters are described.

Reference display device maximum luminance value (RML):

A reference display device, for example, is the mastering monitormentioned above. In one embodiment, the maximum luminance value of thereference display device is a preset value known to both a video contentproduction end and a display end. In another embodiment, the maximumluminance value of the reference display device is transmitted to thedisplay end in a form of static metadata or dynamic metadata, and thedisplay end learns of the value by decoding the metadata.

It should be understood that, some reference display devices maydynamically adjust maximum luminance values, and may adjust differentmaximum luminance values corresponding to different pixels. Therefore,this embodiment of this application is not limited to using same RML forall pixels.

Source Maximum Luminance Value (SML):

The source maximum luminance value is a maximum luminance value of asource picture signal. In one embodiment, the source maximum luminancevalue is a preset value known to both the video content production endand the display end. For example, the source maximum luminance value maybe 10000 nits. In another embodiment, the source maximum luminance valueis transmitted to the display end in a form of static metadata ordynamic metadata, and the display end learns the value by decoding themetadata. For example, In one embodiment, a value of the SML is takenfrom a maximum value of maximum color values of all valid pixels of thesource picture signal.

Target Display Device Maximum Luminance Value (TML):

A target display device is a display device in operation S504 in thisembodiment of this application. A maximum display capability of thetarget display device may be obtained based on a parameter of the targetdisplay device, or obtained based on product information provided by aproduction manufacturer. A minimum display capability of the targetdisplay device is usually 0 nit, or may be 1 nit. This is not limited inthis application.

It should be understood that, similar to the RML, this embodiment ofthis application is not limited to using same TML for all pixels.

Saturation Adjustment Strength (SatR):

The saturation adjustment strength reflects an adjustment strength ofthe video content production end for saturation. In one embodiment, thesaturation adjustment strength is a preset value known to both the videocontent production end and the display end. In another embodiment, thesaturation adjustment strength is transmitted to the display end in aform of static metadata or dynamic metadata, and the display end learnsthe value by decoding the metadata. For example, SatR may be 0.8.

It should be understood that, this embodiment of this application is notlimited to using same SatR for all pixels.

S602: In one embodiment, when the to-be-processed color signal (that is,the color signal obtained after dynamic range conversion is performed)is a non-RGB spatial signal, convert L into a value of an RGB spatialsignal, where correspondingly, L′ is also a value of the RGB spatialsignal.

It should be understood that, this embodiment of this application mayalso be applied to adjustment of another color space. This is notlimited.

S603: Determine a saturation adjustment factor of one color component ofthe color signal based on at least one saturation adjustment parameter.

It may be assumed that N_(in) represents L in operation S502. Forexample, N_(in) may be any one of R_(in), G_(in), and B_(in). W_(N) isthe saturation adjustment factor of the color component represented byN_(in). To be specific, the saturation adjustment factor of the Rcomponent (R_(in)) of the to-be-processed color signal is W_(R), thesaturation adjustment factor of the G component (G_(in)) of theto-be-processed color signal is W_(G), and the saturation adjustmentfactor of the B component (B_(in)) of the to-be-processed color signalis W_(B).

In one embodiment, the saturation adjustment factor is obtained based onthe following formula:

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)}},\ } & {N_{in} \geq \ {RML}} \\{\frac{SatR \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)},} & {{RML}\  > N_{in} \geq {TML}} \\{0,} & {other}\end{matrix}.} \right.$

The saturation adjustment factor may alternatively be determined byusing another formula. This is not limited in this embodiment of thisapplication. For example, a manner of determining the saturationadjustment factor further includes:

Example 1

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)}},} & {N_{in} \geq \ {RML}} \\{\frac{SatR \times \left( {N_{in} - {TML}} \right)}{\left( {{RML} - {TML}} \right)},} & {{RML}\  > N_{in} \geq {TML}} \\{0,} & {other}\end{matrix}.} \right.$

Example 2

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + {\left( {1 - {SatR}} \right) \times \ f1\ \left( N_{in} \right)}},\ } & {N_{in} \geq {RML}} \\{{SatR\  \times f2\left( N_{in} \right)},} & {{RML} > N_{in} \geq {TML}} \\{0,} & {other}\end{matrix},} \right.$

where

f1(N_(in)) is a continuous curve passing through (RML, 0) and (SML, 1),and f2 (N_(in)) is a continuous curve passing through (TML, 0) and (RML,1).

Example 3

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + {\left( {1 - {SatR}} \right) \times \ f1\ \left( N_{in} \right)}},} & {N_{in} \geq {RML}} \\{{SatR\  \times f2\left( N_{in} \right)},\ } & {{RML} > N_{in} \geq {TML}}\end{matrix},} \right.$

where

f1(N_(in)) is a continuous curve passing through (RML, 0), and f2(N_(in)) is a continuous curve passing through (RML, 1).

Example 4

$W_{N} = \left\{ {\begin{matrix}{{f1\ \left( N_{in} \right)},} & {N_{in} \geq {RML}} \\{{f2\left( N_{in} \right)},} & {{RML} > N_{in} \geq {TML}} \\{0,} & {other}\end{matrix},} \right.$

where

f1(N_(in)) is a continuous monotonically increasing curve passingthrough (RML, SatR), and f2(N_(in)) is a continuous monotonicallyincreasing curve passing through (TML, 0) and (RML, SatR).

Example 5

$W_{N} = \left\{ {\begin{matrix}{{f1\left( N_{in} \right)},} & {N_{in} \geq {RML}} \\{{{f2}\left( N_{in} \right)},} & {other}\end{matrix},} \right.$

where

f1(N_(in)) is a continuous monotonically increasing curve passingthrough (RML, SatR), f2 (N_(in)) is a continuous monotonicallyincreasing curve passing through (RML, SatR), and f1(N_(in)) isdifferent from f2(N_(in)).

Example 6

$W_{N} = \left\{ {\begin{matrix}{{{f\; 1\left( N_{in} \right)},}\ } & {N_{in} \geq {R\; M\; L}} \\{{0,}\ } & {other}\end{matrix},} \right.$

where

f1(N_(in)) is a continuous monotonically increasing curve passingthrough (RML, SatR).

Example 7

$W_{N} = \left\{ {\begin{matrix}{{Sa{tR}},} & {N_{in} \geq {RML}} \\{{f2\left( N_{in} \right)}\ ,} & {other}\end{matrix},} \right.$

where

f2(N_(in)) is a continuous monotonically increasing curve passingthrough (RML, SatR).

Example 8

$W_{N} = \left\{ {\begin{matrix}{{Sa{tR}},} & {N_{in} \geq {RML}} \\{0,} & {other}\end{matrix}.} \right.$

It should be understood that, the function f1( ) and/or the function f2() in the foregoing Examples 2 to 7 are not limited in this embodiment ofthis application. For example, Example 1 may be used as one embodimentof any determining manner in Examples 2 to 7. For example, Example 1 isequivalent to Example 2 when

${{{f1\left( N_{in} \right)} = \frac{N_{in} - {RML}}{{SML} - {RML}}},{and}}{{{f2}\left( N_{in} \right)} = \frac{N_{in} - {TML}}{{RML} - {TML}}}$

in Example 2. In addition, clearly, this function satisfies thefollowing condition: f1(N_(in)) is a continuous curve passing through(RML, 0) and (SML, 1), and f2 (N_(in)) is a continuous curve passingthrough (TML, 0) and (RML, 1).

S604: Adjust the color component based on a maximum value of a pluralityof color components of the color signal and the saturation adjustmentfactor of the color component.

When the color signal is an RGB signal, this operation is adjusting oneof R, G, and B components based on a maximum value of the red (R), green(G), and blue (B) components in the RGB signal and the saturationadjustment factor corresponding to one of the R, G, and B components.

In one embodiment, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix},} \right.$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

In another embodiment, the method further includes: adjusting the R, G,and B components based on a first correction strength factor; and

correspondingly, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix},} \right.$

where

C1 is the first correction strength factor.

In one embodiment, the first correction strength factor is obtainedbased on decoded metadata, that is, a value of the first correctionstrength factor is carried in the metadata.

In another embodiment, calculation is performed based on informationcarried in the metadata, to obtain the first correction strength factor.

For example, a syntactic element of color_saturation_gain0 orcolor_saturation_gain1 in the metadata may be decoded to obtain a value,and then the obtained value is divided by 15, to obtain a value of thefirst correction strength factor.

S605: In one embodiment, normalize the color signal obtained aftersaturation adjustment is performed.

To be specific, the RGB signal (R_(out), G_(out), B_(out)) in lineardomain is normalized. A process of normalization processing is anexample, and may be completed based on a process that is of convertinginto a nonlinear PQ signal value and that is specified by an ST 2084,2014-SMPTE standard. Details are not described again. In addition, theprocess of normalization processing is not limited in this embodiment ofthis application.

S606: In one embodiment convert the RGB signal in PQ domain into aYC_(b)C_(r) signal for color adjustment.

It should be understood that the RGB signal in PQ domain mayalternatively be converted into a signal in anotherluminance-chrominance-chrominance format. This is not limited in thisembodiment of this application.

For example, the RGB color signal in the Rec. ITU-R BT.2020-2 format maybe converted into a color signal in the YCbCr format:

$\begin{bmatrix}Y \\C_{b} \\C_{r}\end{bmatrix} = {\begin{bmatrix}{{0.2}627} & {{0.6}780} & {{0.0}593} \\{{- {0.1}}396} & {{- {0.3}}604} & {{0.5}000} \\{{0.5}000} & {{- {0.4}}598} & {{- {0.0}}402}\end{bmatrix} \cdot {\begin{bmatrix}R \\G \\B\end{bmatrix}.}}$

Then, a color adjustment coefficient is determined based on the targetdisplay device maximum luminance value and the saturation adjustmentfactor.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{1 - {C2 \times {SatR}\  \times \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)}}},} & {{RML}\  > Y_{in} > {A \times \ {RML}}} \\{{1 - {C2 \times {SatR}}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, C2 is a second correction strength factor, Y_(in) is aluminance component value of the luminance-chrominance-chrominancesignal, and A is a rational number less than 1 and greater than 0.

In another embodiment, the color adjustment coefficient is obtainedbased on the following formula:

$S = \left\{ {\begin{matrix}{\left( \frac{Yorg}{Y_{in}} \right)^{C3},} & {{A \times {RML}} \geq Y_{in}} \\{{1 - {C2 \times {SatR}\  \times \frac{\left( {Y_{in} - {A \times {TML}}} \right)}{\left( {{TML} - {A \times {TML}}} \right)}}},} & {{RML}\  > Y_{in} > {A \times \ {RML}}} \\{{1 - {C2 \times {SatR}}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

C3 is a third correction strength factor, and Yorg is a value of a Ycomponent of the color signal obtained by decoding the bitstream beforetone-mapping is performed.

Manners of obtaining C2 and C3 are similar to the manner of obtainingC1. Details are not described again. A may be determined based on apreset value, or may be determined based on the decoded metadata.

In one embodiment, a value of A is ⅔.

In another embodiment, a set of pixels whose at least two colorcomponents are less than or equal to TML is determined from pixels ofthe RGB signal, a pixel with a largest luminance component value isdetermined from the pixel set, and the largest luminance value is usedas A.

In another embodiment, the color adjustment coefficient is obtainedbased on the following formula:

$S = \left\{ {\begin{matrix}{{1 - {C2\  \times {SatR}\  \times \ f1\ \left( Y_{in} \right)}}\ ,\ } & {{TML}\  > Y_{in} \geq {A \times \ {TML}}} \\{{1 - {C2\  \times {SatR}}},\ } & {Y_{in} \geq {TML}}\end{matrix},} \right.$

where

f1(Y_(in)) is a continuous curve passing through (A*TML, 1) and (TML,1-SatR).

For example,

${f1\left( Y_{in} \right)} = {\frac{\left( {Y_{in} - {A \times {TML}}} \right)}{\left( {{TML} - {A \times {TML}}} \right)}.}$

To be specific, the foregoing formula for determining the coloradjustment coefficient is one embodiment of this implementation.

In some feasible implementations, values of SatR used to determine thesaturation adjustment factor and SatR used to determine the coloradjustment coefficient may be different. To be specific, before thecolor adjustment coefficient is determined, SatR may be adjusted. Forexample, the value of SatR may be adjusted from 0.8 to 1.

After the color adjustment coefficient is determined, a chrominancecomponent of the luminance-chrominance-chrominance signal is adjustedbased on the color adjustment coefficient.

For example, the adjusted color signal in the YC_(b)C_(r) format is:

C_(b)^(′) = C_(b) ⋅ S;  and C_(r)^(′) = C_(r) ⋅ S.

The luminance component of the color signal in the YC_(b)C_(r) formatdoes not need to be adjusted, that is, Y′=Y_(in), C_(b), C_(r) arerespectively chrominance components of the color signal in theYC_(b)C_(r) format before adjustment, and C_(b)′, C_(r)′ arerespectively chrominance components of the adjusted color signal in theYC_(b)C_(r) format.

It should be understood that the color adjustment coefficient S may alsobe used to adjust a signal after non-tone-mapping is performed. This isnot limited in this application.

S607: In one embodiment, finally convert the signal after coloradjustment is performed into a signal format adapted to display.

It should be understood that, in some other embodiments, operations S605to S607 may be used as part of post-processing of the to-be-displayedsignal before operation S504.

FIG. 7 is a schematic diagram of a structure of a picture signalconversion processing apparatus according to an embodiment of thisapplication. The picture signal conversion processing apparatus providedin this embodiment of the present disclosure may be configured toimplement some or all of procedures of the picture signal conversionprocessing method embodiment described with reference to FIG. 5 or FIG.6 in the present disclosure. A saturation adjustment apparatus 700 shownin FIG. 7 includes: a calculation module 701, configured to determine asaturation adjustment factor of one color component of a color signalbased on at least one saturation adjustment parameter, where thesaturation parameter includes: a reference display device maximumluminance value (RML), a source maximum luminance value (SML), a targetdisplay device maximum luminance value (TML), and a saturationadjustment strength (SatR); and a conversion module 702, configured toadjust the color component based on a maximum value of a plurality ofcolor components of the color signal and the saturation adjustmentfactor of the color component.

In one embodiment, the color signal is an RGB signal, and the conversionmodule 702 is configured to: adjust one of R, G, and B components basedon a maximum value of the red (R), green (G), and blue (B) components inthe RGB signal and the saturation adjustment factor corresponding to oneof the R, G, and B components.

In one embodiment, the R, G, and B components are adjusted based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix},} \right.$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

In one embodiment, the conversion module 702 is further configured to:adjust the R, G, and B components based on a first correction strengthfactor; and correspondingly, the R, G, and B components are adjustedbased on the following formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix},} \right.$

where

C1 is the first correction strength factor.

In one embodiment, the first correction strength factor is obtainedbased on decoded metadata, or is calculated based on information carriedin the metadata.

In one embodiment, the color signal is a to-be-displayed signal afterdynamic range adjustment is performed.

In one embodiment, the saturation adjustment factor is obtained based onthe following formula:

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)}},\ } & {N_{in} \geq \ {RML}} \\{\frac{{SatR} \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)},\ } & {{RML}\  > N_{in} \geq {TML}} \\{0,\ } & {other}\end{matrix},} \right.$

where

N_(in) is one of R_(in), G_(in), B_(in), and W_(N) is the saturationadjustment factor corresponding to the color component represented byN_(in).

In one embodiment, at least one of the reference display device maximumluminance value, the source maximum luminance value, and the saturationadjustment strength is determined based on a preset value, or at leastone of the reference display device maximum luminance value, the sourcemaximum luminance value, and the saturation adjustment strength isdetermined based on the decoded metadata.

In one embodiment, the saturation adjustment strength is 0.8.

In one embodiment, the target display device maximum luminance value isobtained based on a parameter of a target display device.

In one embodiment, when the color signal is a non-RGB signal, thecalculation module is further configured to: convert the non-RGB signalinto an RGB signal and use the RGB signal as the color signal.

FIG. 8 is a schematic flowchart of another picture signal conversionprocessing method according to an embodiment of this application. In oneembodiment, FIG. 8 shows a chrominance adjustment method.

It may be assumed that the chrominance adjustment is performed after atone-mapping operation, a picture signal of a to-be-processed frame isR, G, and B of RGB color space before tone-mapping is performed, and thepicture signal of the to-be-processed frame is Rt, Gt, and Bt of the RGBcolor space after tone-mapping is performed. In this case,

a signal that is of YC_(b)C_(r) space and that corresponds to thepicture signal of the to-be-processed frame before tone-mapping isperformed may be obtained based on the following formula:

${\begin{bmatrix}Y_{in} \\C_{b\_ in} \\C_{r\_ in}\end{bmatrix} = {\begin{bmatrix}{{0.2}627} & {{0.6}780} & {{0.0}593} \\{{- {0.1}}396} & {{- {0.3}}604} & {{0.5}000} \\{{0.5}000} & {{- {0.4}}598} & {{- {0.0}}402}\end{bmatrix} \cdot \begin{bmatrix}R \\G \\B\end{bmatrix}}},$

where

Y_(in), C_(b_in), C_(r_in) are respectively luminance, a firstchrominance component, and a second chrominance component of the picturesignal of the to-be-processed frame in the YC_(b)C_(r) space.

A signal that is of the YC_(b)C_(r) space and that corresponds to thepicture signal of the to-be-processed frame after tone-mapping isperformed may be obtained based on the following formula:

${\begin{bmatrix}Y \\C_{b} \\C_{r}\end{bmatrix} = {\begin{bmatrix}{{0.2}627} & {{0.6}780} & {{0.0}593} \\{{- {0.1}}396} & {{- {0.3}}604} & {{0.5}000} \\{{0.5}000} & {{- {0.4}}598} & {{- {0.0}}402}\end{bmatrix} \cdot \begin{bmatrix}{Rt} \\{Gt} \\{Bt}\end{bmatrix}}},$

where

Y, C_(b), C_(r) are respectively luminance, a first chrominancecomponent, and a second chrominance component of the picture signal ofthe to-be-processed frame in the YC_(b)C_(r) space.

It should be understood that, in this embodiment of this application,color space conversion conforms to a standard of ITU-BT2020. The RGBcolor signal in the Rec. ITU-R BT.2020-2 format is converted into acolor signal in the YC_(b)C_(r) format. A conversion methodcorresponding to another color space may also be applied to thisembodiment of this application. This is not limited.

S801: Calculate a color adjustment coefficient.

In one embodiment, a color adjustment coefficient of a chrominancecomponent of a color signal is determined based on a reference displaydevice maximum luminance value (RML) and/or a source maximum luminancevalue (SML).

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1\  \times {f\left( \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)} \right)}}},\ } & {{RML} > Y_{in} > {A \times \ {RML}}} \\{{B - {C2\  \times {SatR}1}},\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

In another embodiment, the color adjustment coefficient is obtainedbased on the following formula:

$S = \left\{ {\begin{matrix}{\begin{matrix}{B - {C2\  \times \ {SatR}1\  \times}} \\{{f\left( \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)} \right)},}\end{matrix}\ } & {{RML} > Y_{in} > {A \times \ {RML}}} \\{\begin{matrix}{B - {C2\  \times {SatR}1} -} \\{C2 \times {SatR}2 \times {g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)} \right)}}\end{matrix},\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonic increasing function when x is in aninterval 0 to 1, SatR1 is a first saturation adjustment coefficient,g(x) is a monotonic increasing function when x is in an interval 0 to 1,and SatR2 is a second saturation adjustment coefficient.

In another embodiment, the color adjustment coefficient is obtainedbased on the following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1 \times {f\left( \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)} \right)}}},\ } & {{RML} > Y_{in} > {A \times \ {RML}}} \\{B - {C2\  \times {SatR}1} - {{C2} \times {SatR}2 \times \ {const}\ }} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonic increasing function when x is in aninterval 0 to 1, SatR1 is a first saturation adjustment coefficient,SatR2 is a second saturation adjustment coefficient, and const is aconstant.

In one embodiment, at least one of RML, SML, A, B, C2, SatR1, and SatR2is obtained based on decoded metadata, or is calculated based oninformation carried in the metadata.

It should be understood that, the foregoing parameters may all beobtained in one obtaining manner, or may be separately obtained indifferent obtaining manners.

In one embodiment, A is a preset value, and 0<A≤1. For example, A may be0.1, 0.3, ⅓, 0.4, 0.5, 0.6, ⅔, 0.7, 0.8, or 0.9.

In another embodiment, A is calculated based on characteristics of asource picture signal. In one embodiment:

S91: Calculate a maximum color value of pixels in one pixel set in whichthe to-be-processed color signal is located.

The pixel set may be a picture frame or a picture sequence in which theto-be-processed color signal is located, or the like. It may be assumedthat a maximum value in R, G, and B components of the RGB signal is themaximum color value. The maximum color value is obtained for each pixelin the pixel set. In different embodiments, alternatively, a minimumvalue, an intermediate value, or the like of R, G, and B components of apixel may be obtained.

S92: Filter a pixel whose maximum color value is greater than RML fromthe pixel set in S91, to obtain a pixel subset.

S93: Perform cumulative histogram statistics on luminance values (Ycomponents) of pixels in the pixel subset. A target luminance value This determined, and is enabled to meet the following condition: anaccumulated quantity of pixels whose luminance values are between 0 andthe target luminance value reaches a value of a preset ratio of a totalquantity of the pixels of the pixel subset. For example, the presetratio value may be 10%, 20%, 30%, 40%, or 50%.

S94: Determine A based on the target luminance value, where whenTh/RML<TML/RML, A=TML/RML; when Th/RML>TT, A=TT; otherwise, A=Th/RML. TTis a preset value. For example, TT is 0.1, 0.3, ⅓, 0.4, 0.5, 0.6, ⅔,0.7, 0.8, or 0.9.

In one embodiment, B is a preset value, and 0<B≤1. For example, B may be0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, B is determined based on the source maximum luminancevalue and a target display device maximum luminance value (TML). Forexample, B=SML/TML.

In another embodiment, B is determined based on the source maximumluminance values of a plurality of picture frames and TML. For example,B=ΣW_(i)×SML_(i)/TML, where i is an index of each frame in the pluralityof picture frames, and W_(i) is a coefficient value of an ith frame.

In one embodiment, SatR1 and SatR2 are preset values, 0<SatR1≤1, and0<SatR2≤1. For example, SatR1 and SatR2 may be 0.3, 0.4, 0.5, 0.6, 0.7,0.8, or 0.9.

In one embodiment, SatR1+SatR2≤1.

In one embodiment, SatR1 and SatR2 are calculated based oncharacteristics of a source picture signal. For example, SatR1 and SatR2may be determined based on a picture frame in which the to-be-processedpicture signal is located and characteristics of color signals of someor all of pixels in the plurality of picture frames.

In one embodiment, f(x)=x.

In one embodiment, g(x)=x.

In one embodiment, f(x)=x^(N), and N>0.

In one embodiment, g(x)=x^(M), and M>0.

In one embodiment, for example, const may be 0, 0.3, 0.4, 0.5, 0.6, 0.7,0.8, 0.9, or 1.0.

In one embodiment, it may be assumed that the color adjustmentcoefficient is obtained based on the following formula:

$S = \left\{ {\begin{matrix}{\left( \frac{Y}{Y_{in}} \right)^{C1},} & {{A \times {RML}} > Y} \\{{1 - {C2 \times {SatR}\  \times \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)}}},} & {{RML}\  > Y_{in} \geq {A \times \ {RML}}} \\{{1 - {C2 \times {SatR}}},} & {Y \geq {RML}}\end{matrix},} \right.$

where

C1, C2, RML, and SML are obtained based on the decoded metadata, SatR is0.8, and A=TML/RML.

For example, syntactic elements color_saturation_gain1 andcolor_saturation_gain2 may be decoded from the metadata, to calculatethe values of C1 and C2:

C 1 = color_saturation_gain1/15;  and C 2 = color_saturation_gain2/15.

S802: Adjust the chrominance component of the color signal based on thecolor adjustment coefficient.

For example, the chrominance components C_(b) and C_(r) are multipliedby the same color adjustment coefficient, to adjust the chrominancecomponents:

Y^(′) = YC_(b)^(′) = C_(b) ⋅ SC_(r)^(′) = C_(r) ⋅ S.

Y′, C_(b)′, C_(r)′ are adjusted chrominance components. Clearly, theluminance component does not change before and after adjustment.

S803: In one embodiment, convert the adjusted color signal from theYC_(b)C_(r) color space back to the RGB color space:

$\begin{bmatrix}R_{ca}^{\prime} \\G_{ca}^{\prime} \\B_{ca}^{\prime}\end{bmatrix} = {\begin{bmatrix}{{1.0}000} & {{0.0}000} & {{1.4}746} \\{{1.0}000} & {{- {0.1}}645} & {{- {0.5}}713} \\{{1.0}000} & {{1.8}814} & {{- {0.0}}001}\end{bmatrix} \cdot {\begin{bmatrix}Y^{\prime} \\C_{b}^{\prime} \\C_{r}^{\prime}\end{bmatrix}.}}$

S804: In one embodiment, denormalize the converted RGB signal from PQdomain to linear domain.

FIG. 9 is a schematic diagram of a structure of a picture signalconversion processing apparatus according to an embodiment of thisapplication. The picture signal conversion processing apparatus providedin this embodiment of the present disclosure may be configured toimplement some or all of procedures of the picture signal conversionprocessing method embodiment described with reference to FIG. 8 in thepresent disclosure. A chrominance adjustment apparatus 900 shown in FIG.9 includes: a calculation module 901, configured to determine a coloradjustment coefficient of a chrominance component of a color signalbased on a reference display device maximum luminance value (RML) and/ora source maximum luminance value (SML); and a conversion module 902,configured to adjust the chrominance component of the color signal basedon the color adjustment coefficient.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2\  \times \ {SatR}\; 1\  \times {f\left( \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)} \right)}}},}\ } & {{RML} > Y_{in} > {A \times \ {RML}}} \\{{{B - {C\; 2\  \times {SatR}\; 1}},}\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

For example, the foregoing formula may be:

$S = \left\{ {\begin{matrix}{{{B - {C\; 2\  \times \ {SatR}\; 1\  \times \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)}}},}\ } & {{RML}\  > Y_{in} > {A \times \ {RML}}} \\{{{B - {C\; 2\  \times {SatR}\; 1}},}\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

For example, the foregoing formula may be simplified as:

$S = \left\{ {\begin{matrix}{{{1 - {C2 \times \ {SatR}\; 1\  \times \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)}}},}\ } & {{RML}\  > Y_{in} > {A \times \ {RML}}} \\{{{1 - {C2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

SatR1 is 0.8 or 0.7.

In one embodiment, the color adjustment coefficient is obtained based onthe following formula:

$S = \left\{ {\begin{matrix}{\begin{matrix}{B - {C\; 2\  \times \ {SatR}\; 1\  \times}} \\{{f\left( \frac{\left( {Y_{in} - {A \times {RML}}} \right)}{\left( {{RML} - {A \times {RML}}} \right)} \right)},}\end{matrix}\ } & {{RML} > Y_{in} > {A \times \ {RML}}} \\{\begin{matrix}{B - {C\; 2\  \times {SatR}\; 1} - {C\; 2 \times}} \\{{{SatR}\; 2 \times {g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)} \right)}},}\end{matrix}\ } & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

g(x) is a monotonically increasing function when x is in an interval 0to 1, and SatR2 is a second saturation adjustment coefficient.

In one embodiment, at least one of RML, SML, A, B, C2, SatR1, and SatR2is obtained based on decoded metadata, or is calculated based oninformation carried in the metadata.

In one embodiment, the reference display device maximum luminance valueand/or the source maximum luminance value are/is determined based on apreset value, or determined based on the decoded metadata.

In one embodiment, A is a preset value, and 0<A≤1. For example, A may be0.1, 0.3, ⅓, 0.4, 0.5, 0.6, ⅔, 0.7, 0.8, or 0.9.

In one embodiment, B is a preset value, and 0<B≤1. For example, B may be0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, B is determined based on the source maximum luminancevalue and a target display device maximum luminance value (TML).

In one embodiment, B is a ratio of SML to TML.

In one embodiment, SatR1 and SatR2 are preset values, 0<SatR1≤1, and0<SatR2≤1. For example, SatR1 and SatR2 may be 0.3, 0.4, 0.5, 0.6, 0.7,0.8, or 0.9.

In one embodiment, SatR1+SatR2≤1.

In one embodiment, f(x)=x.

In one embodiment, g(x)=x.

In one embodiment, f(x)=x^(N), and N>0.

In one embodiment, g(x)=x^(M), and M>0.

In one embodiment, g(x)=const, and const is a constant. For example,const may be 0, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, or 1.0.

In one embodiment, the chrominance component is adjusted based on thefollowing formulas:

C_(b)^(′) = C_(b) ⋅ S; and C_(r)^(′) = C_(r) ⋅ S,

where

C_(b), C_(r) are chrominance components before the color signal isadjusted, and C_(b)′, C_(r)′ are chrominance components after the colorsignal is adjusted.

In one embodiment, a color correction process includes:

Input: an RGB color gamut pixel buffer f[N_(frame)] [3] of ato-be-processed frame, an RGB color gamut pixel buffer f_(TM)[N_(frame)][3] on which dynamic range conversion processing is performed of theto-be-processed frame, metadata data information, and a value RML of amaximum display luminance MaxDisplay of a display luminance range of adisplay device in PQ domain.

Output: a processed RGB color gamut pixel buffer f_(color)[N_(frame)][3] of the to-be-processed frame.

A process of color correction is as follows:

(1) If a color correction identifier color saturation mapping flag is 0,f_(color)[N_(frame)][0]=f_(TM)[N_(frame)] [0],f_(color)[N_(frame)][1]=f_(TM)[N_(frame)] [1], f_(color) [N_(frame)][2]=f_(TM)[N_(frame)] [2], and the color correction process is ended.

Otherwise, color correction strengths C0 and C1 are calculated:

$\begin{matrix}{{{{C0} = {{color\_ saturation}{{\_ gain}\lbrack 0\rbrack}}};\mspace{14mu}{and}}{{C\; 1} = {{color\_ saturation}{{{\_ gain}\lbrack 1\rbrack}.}}}} & \;\end{matrix}$

(2) An input to-be-processed RGB signal f[i] [3] in PQ domain isconverted into a color signal Y_(in)C_(b_in)C_(r_in) in the YC_(b)C_(r)format based on ITU-BT2020:

$\begin{bmatrix}Y_{in} \\C_{b\_ in} \\C_{r\_ in}\end{bmatrix} = {\begin{bmatrix}{{0.2}627} & {{0.6}780} & {{0.0}593} \\{{- {0.1}}396} & {{- {0.3}}604} & {{0.5}000} \\{{0.5}000} & {{- {0.4}}598} & {{- {0.0}}402}\end{bmatrix} \cdot {\begin{bmatrix}{{f\lbrack i\rbrack}\lbrack 0\rbrack} \\{{f\lbrack i\rbrack}\lbrack 1\rbrack} \\{{f\lbrack i\rbrack}\lbrack 2\rbrack}\end{bmatrix}.}}$

An RGB linear signal f_(TM)[i][3] is converted into a nonlinear signalf_(TM_PQ)[i][3] in PQ domain:

$\begin{matrix}{{{f_{{TM}\_{PQ}}\lbrack i\rbrack}\lbrack 3\rbrack} = {{PQ\_ EOTF}^{- 1}{\left( {{f_{TM}\lbrack i\rbrack}\lbrack 3\rbrack} \right).}}} & \;\end{matrix}$

f_(TM_PQ)[i][3] is converted into a color signal YC_(b)C_(r) in theYC_(b)C_(r) format based on ITU-BT2020:

$\begin{bmatrix}Y \\C_{b} \\C_{\gamma}\end{bmatrix} = {\begin{bmatrix}{{0.2}627} & {{0.6}780} & {{0.0}593} \\{{- {0.1}}396} & {{- {0.3}}604} & {{0.5}000} \\{{0.5}000} & {{- {0.4}}598} & {{- {0.0}}402}\end{bmatrix} \cdot {\begin{bmatrix}{{f_{TM\_ PQ}\lbrack i\rbrack}\lbrack 0\rbrack} \\{{f_{TM\_ PQ}\lbrack i\rbrack}\lbrack 1\rbrack} \\{{f_{TM\_ PQ}\lbrack i\rbrack}\lbrack 2\rbrack}\end{bmatrix}.}}$

(3) The color adjustment coefficient S_(ca) is calculated:

1. If Y is greater than A*RML,

$S_{ca} = \left\{ {\begin{matrix}{{B - {C1 \times {SatR} \times \ \left( \frac{Y_{in} - {A \times {RML}}}{{RML} - {A \times {RML}}} \right)}}\ } & {{A \times {RML}} < Y < {RML}} \\{{B - {C1 \times {SatR}}}\ } & {Y \geq {RML}}\end{matrix},} \right.$

where

A is an adjustment range coefficient, B is a strength range coefficient,SatR is a saturation correction factor, TML is a target display devicemaximum luminance value, and RML is a reference display device maximumluminance value. SatR uses 0.7 by default, a value of A is TML/RML bydefault, and a value of B is 1 by default.

2. Otherwise, the color adjustment coefficient S_(ca) is related to aluminance Y and a tone-mapping curve, and a calculation formula is:

${S_{ca} = \left( \frac{Y}{Y_{in}} \right)^{C0}},{k \in \left\lbrack {0,1} \right\rbrack},$

where

Y_(in) is a Y component of the YC_(b)C_(r) signal that is in PQ domainand that is converted from the input signal in linear RGB domain.

(4) Color adjustment is performed on the YC_(b)C_(r) signal.

C_(b) and C_(r) are multiplied by the same color adjustment coefficientS_(ca):

Y^(′) = Y C_(b)^(′) = C_(b) ⋅ S_(ca) C_(r)^(′) = C_(r) ⋅ S_(ca).

The YC_(b)C_(r) signal is converted back to the RGB signal in PQ domain:

$\begin{bmatrix}R_{ca}^{\prime} \\G_{ca}^{\prime} \\B_{ca}^{\prime}\end{bmatrix} = {\begin{bmatrix}{{1.0}000} & {{0.0}000} & {{1.4}746} \\{{1.0}000} & {{- {0.1}}645} & {{- {0.5}}713} \\{{1.0}000} & {{1.8}814} & {{- {0.0}}001}\end{bmatrix} \cdot {\begin{bmatrix}Y^{\prime} \\C_{b}^{\prime} \\C_{r}^{\prime}\end{bmatrix}.}}$

(5) The RGB signal in PQ domain is converted back to linear domain toobtain (R_(color1), G_(color1), B_(color1)):

R_(color 1) = PQ_EOTF(R_(ca)^(′));G_(color 1) = PQ_EOTF(G_(ca)^(′));  andB_(color 1) = PQ_EOTF(B_(ca)^(′)).

(6) f_(color)[N_(frame)][0]=R_(color1),f_(color)[N_(frame)][1]=G_(color1), andf_(color)[N_(frame)][2]=B_(color1).

FIG. 10 is a schematic diagram of a structure of a terminal deviceaccording to an embodiment of this application. As shown in FIG. 10, theterminal device 1000 may include: a processor 1001, a memory 1002, aninput apparatus 1003, and an output apparatus 1004. The processor 1001is connected to the memory 1002, the input apparatus 1003, and theoutput apparatus 1004. For example, the processor 1001 may be connectedto the memory 1002, the input apparatus 1003, and the output apparatus1004 by using a bus.

The processor 1001 may be a central processing unit (CPU), a networkprocessor (NP), or the like.

The memory 1002 may include a volatile memory, such as a random-accessmemory (RAM); or the memory may include a non-volatile memory, such as aread-only memory (ROM), a flash memory, a hard disk drive (HDD), or asolid-state drive (SSD); or the memory may include a combination of thememories of the foregoing types.

The processor 1001 is configured to perform some or all of procedures inthe picture signal conversion processing method embodiment described inFIG. 5, FIG. 6, or FIG. 8.

Example 1: A saturation adjustment method, including:

determining a saturation adjustment factor of one color component of acolor signal based on at least one saturation adjustment parameter,where the saturation parameter includes: a reference display devicemaximum luminance value (RML), a source maximum luminance value (SML), atarget display device maximum luminance value (TML), and a saturationadjustment strength (SatR); and

adjusting the color component based on a maximum value of a plurality ofcolor components of the color signal and the saturation adjustmentfactor of the color component.

Example 2: The method according to Example 1, where the color signal isan RGB signal, and the adjusting the color component based on a maximumvalue of a plurality of color components of the color signal and thesaturation adjustment factor of the color component includes:

adjusting one of R, G, and B components based on a maximum value of thered (R), green (G), and blue (B) components in the RGB signal and thesaturation adjustment factor corresponding to one of the R, G, and Bcomponents.

Example 3: The method according to Example 1 or 2, where the R, G, and Bcomponents are adjusted based on the following formulas:

$\left\{ \begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix} \right.,$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

Example 4: The method according to Example 3, further including:adjusting the R, G, and B components based on a first correctionstrength factor; and correspondingly, adjusting the R, G, and Bcomponents based on the following formulas:

$\left\{ \begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C\; 1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix} \right.,$

where

C1 is the first correction strength factor.

Example 5: The method according to Example 4, where the first correctionstrength factor is obtained based on decoded metadata, or is calculatedbased on information carried in the metadata.

Example 6: The method according to any one of Examples 1 to 5, where thecolor signal is a to-be-displayed signal after dynamic range adjustmentis performed.

Example 7: The method according to any one of Examples 2 to 6, where thesaturation adjustment factor is obtained based on the following formula:

${W_{N} = \left\{ \begin{matrix}{{{{SatR}\  + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)}},}\ } & {N_{in} \geq \ {RML}} \\{{\frac{{SatR} \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)},}\ } & {{RML}\  > N_{in} \geq {TML}} \\{{0,}\ } & {other}\end{matrix} \right.},$

where

N_(in) is one of R_(in), G_(in), B_(in), and W_(N) is the saturationadjustment factor corresponding to the color component represented byN_(in).

Example 8: The method according to any one of Examples 5 to 7, where atleast one of the reference display device maximum luminance value, thesource maximum luminance value, and the saturation adjustment strengthis determined based on a preset value, or at least one of the referencedisplay device maximum luminance value, the source maximum luminancevalue, and the saturation adjustment strength is determined based on thedecoded metadata.

Example 9: The method according to Example 8, where the saturationadjustment strength is 0.8.

Example 10: The method according to any one of Examples 1 to 9, wherethe target display device maximum luminance value is obtained based on aparameter of a target display device.

Example 11: The method according to any one of Examples 1 to 10, wherewhen the color signal is a non-RGB signal, before the determining asaturation adjustment factor of one color component of a color signalbased on at least one saturation adjustment parameter, the methodfurther includes:

converting the non-RGB signal into an RGB signal and using the RGBsignal as the color signal.

Example 12: A saturation adjustment apparatus, including:

a calculation module, configured to determine a saturation adjustmentfactor of one color component of a color signal based on at least onesaturation adjustment parameter, where the saturation parameterincludes: a reference display device maximum luminance value (RML), asource maximum luminance value (SML), a target display device maximumluminance value (TML), and a saturation adjustment strength (SatR); and

a conversion module, configured to adjust the color component based on amaximum value of a plurality of color components of the color signal andthe saturation adjustment factor of the color component.

Example 13: The apparatus according to Example 12, where the colorsignal is an RGB signal, and the conversion module is configured to:

adjust one of R, G, and B components based on a maximum value of the red(R), green (G), and blue (B) components in the RGB signal and thesaturation adjustment factor corresponding to one of the R, G, and Bcomponents.

Example 14: The apparatus according to Example 12 or 13, where the R, G,and B components are adjusted based on the following formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R}}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G}}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B}}}}\end{matrix},} \right.$

where

R_(in), G_(in), B_(in) are respectively the R, G, and B components inthe RGB signal, MAX( ) is a maximum value obtaining function, W_(R),W_(G), W_(B) are respectively saturation adjustment factorscorresponding to the R, G, and B components, and R_(out), G_(out),B_(out) are respectively the adjusted R, G, and B components.

Example 15: The apparatus according to Example 14, where the conversionmodule is further configured to: adjust the R, G, and B components basedon a first correction strength factor; and

correspondingly, adjust the R, G, and B components based on thefollowing formulas:

$\left\{ {\begin{matrix}{R_{out} = {R_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - R_{in}} \right) \times W_{R} \times C1}}} \\{G_{out} = {G_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - G_{in}} \right) \times W_{G} \times C1}}} \\{B_{out} = {B_{in} + {\left( {{{MAX}\left( {R_{in},G_{in},B_{in}} \right)} - B_{in}} \right) \times W_{B} \times C1}}}\end{matrix},} \right.$

where

C1 is the first correction strength factor.

Example 16: The apparatus according to Example 15, where the firstcorrection strength factor is obtained based on decoded metadata, or iscalculated based on information carried in the metadata.

Example 17: The apparatus according to any one of Examples 12 to 15,where the color signal is a to-be-displayed signal after dynamic rangeadjustment is performed.

Example 18: The apparatus according to any one of Examples 13 to 17,where the saturation adjustment factor is obtained based on thefollowing formula:

$W_{N} = \left\{ {\begin{matrix}{{{SatR}\  + \frac{\left( {1 - {SatR}} \right) \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)}},} & {N_{in} \geq \ {RML}} \\{\frac{SatR \times \left( {N_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)},} & {{RML}\  > N_{in} \geq {TML}} \\{0,} & {other}\end{matrix},} \right.$

where

N_(in) is one of R_(in), G_(in), B_(in), and W_(N) is the saturationadjustment factor corresponding to the color component represented byN_(in).

Example 19: The apparatus according to any one of Examples 16 to 18,where at least one of the reference display device maximum luminancevalue, the source maximum luminance value, and the saturation adjustmentstrength is determined based on a preset value, or at least one of thereference display device maximum luminance value, the source maximumluminance value, and the saturation adjustment strength is determinedbased on the decoded metadata.

Example 20: The apparatus according to Example 19, where the saturationadjustment strength is 0.8.

Example 21: The apparatus according to any one of Examples 12 to 20,where the target display device maximum luminance value is obtainedbased on a parameter of a target display device.

Example 22: The apparatus according to any one of Examples 12 to 21,where when the color signal is a non-RGB signal, the calculation moduleis further configured to:

convert the non-RGB signal into an RGB signal and use the RGB signal asthe color signal.

Example 23: A chrominance adjustment method, including:

determining a color adjustment coefficient of a chrominance component ofa color signal based on a reference display device maximum luminancevalue (RML) and/or a source maximum luminance value (SML); and

adjusting the chrominance component of the color signal based on thecolor adjustment coefficient.

Example 24: The method according to Example 23, where the coloradjustment coefficient is obtained based on the following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1 \times f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}},} & {{RML} > Y_{in} > {A \times \ RML}} \\{{B - {C2\  \times {SatR}1}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

Example 25: The method according to Example 23, where the coloradjustment coefficient is obtained based on the following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1\  \times f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}},} & {{RML} > Y_{in} > {A \times \ RML}} \\{{B - {C2\  \times {SatR}1} - {C2 \times SatR2 \times g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)} \right)}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

g(x) is a monotonically increasing function when x is in an interval 0to 1, and SatR2 is a second saturation adjustment coefficient.

Example 26: The method according to Example 25, where at least one ofRML, SML, A, B, C2, SatR1, and SatR2 is obtained based on decodedmetadata, or is calculated based on information carried in the metadata.

Example 27: The method according to any one of Examples 24 to 26, wherethe reference display device maximum luminance value and/or the sourcemaximum luminance value are/is determined based on a preset value, ordetermined based on the decoded metadata.

Example 28: The method according to any one of Examples 24 to 27, whereA is a preset value, and 0<A≤1.

Example 29: The method according to any one of Examples 24 to 28, whereB is a preset value, and 0<B≤1.

Example 30: The method according to any one of Examples 24 to 28, whereB is determined based on the source maximum luminance value and a targetdisplay device maximum luminance value (TML).

Example 31: The method according to Example 30, where B is a ratio ofSML to TML.

Example 32: The method according to any one of Examples 24 to 31, whereSatR1 and SatR2 are preset values, 0<SatR1≤1, and 0<SatR2≤1.

Example 33: The method according to Example 32, where SatR1+SatR2≤1.

Example 34: The method according to any one of Examples 24 to 33, wheref(x)=x.

Example 35: The method according to any one of Examples 24 to 33, wheref(x)=x^(N), and N>0.

Example 36: The method according to any one of Examples 25 to 35, whereg(x)=x^(M), and M>0.

Example 37: The method according to any one of Examples 25 to 36, whereg(x)=x.

Example 38: The method according to any one of Examples 24 to 37, wherethe chrominance component is adjusted based on the following formulas:

C_(b)^(′) = C_(b) ⋅ S; andC_(r)^(′) = C_(r) ⋅ S,

where

C_(b), C_(r) are chrominance components before the color signal isadjusted, and C_(b)′, C_(r)′ are chrominance components after the colorsignal is adjusted.

Example 39: A chrominance adjustment apparatus, including:

a calculation module, configured to determine a color adjustmentcoefficient of a chrominance component of a color signal based on areference display device maximum luminance value (RML) and/or a sourcemaximum luminance value (SML); and

a conversion module, configured to adjust the chrominance component ofthe color signal based on the color adjustment coefficient.

Example 40: The apparatus according to Example 39, where the coloradjustment coefficient is obtained based on the following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1 \times f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}},} & {{RML} > Y_{in} > {A \times \ RML}} \\{{B - {C2\  \times {SatR}1}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

S is the color adjustment coefficient, A is an adjustment rangecoefficient, B is a strength range coefficient, C2 is a secondcorrection strength factor, Y_(in) is a luminance component value of thecolor signal, f(x) is a monotonically increasing function when x is inan interval 0 to 1, and SatR1 is a first saturation adjustmentcoefficient.

Example 41: The apparatus according to Example 39, where the coloradjustment coefficient is obtained based on the following formula:

$S = \left\{ {\begin{matrix}{{B - {C2\  \times \ {SatR}1\  \times f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}},} & {{RML} > Y_{in} > {A \times \ RML}} \\{{B - {C2\  \times {SatR}1} - {C2 \times SatR2 \times g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)} \right)}},} & {Y_{in} \geq {RML}}\end{matrix},} \right.$

where

g(x) is a monotonically increasing function when x is in an interval 0to 1, and SatR2 is a second saturation adjustment coefficient.

Example 42: The apparatus according to Example 41, where at least one ofRML, SML, A, B, C2, SatR1, and SatR2 is obtained based on decodedmetadata, or is calculated based on information carried in the metadata.

Example 43: The apparatus according to any one of Examples 40 to 42,where the reference display device maximum luminance value and/or thesource maximum luminance value are/is determined based on a presetvalue, or determined based on the decoded metadata.

Example 44: The apparatus according to any one of Examples 40 to 43,where A is a preset value, and 0<A≤1.

Example 45: The apparatus according to any one of Examples 40 to 44,where B is a preset value, and 0<B≤1.

Example 46: The apparatus according to any one of Examples 40 to 44,where B is determined based on the source maximum luminance value and atarget display device maximum luminance value (TML).

Example 47: The apparatus according to Example 46, where B is a ratio ofSML to TML.

Example 48: The apparatus according to any one of Examples 40 to 47,where SatR1 and SatR2 are preset values, 0<SatR1≤1, and 0<SatR2≤1.

Example 49: The apparatus according to Example 48, where SatR1+SatR2≤1.

Example 50: The apparatus according to any one of Examples 40 to 49,where f(x)=x.

Example 51: The apparatus according to any one of Examples 40 to 49,where f(x)=x^(N), and N>0.

Example 52: The apparatus according to any one of Examples 41 to 51,where g(x)=x^(M), and M>0.

Example 53: The apparatus according to any one of Examples 41 to 52,where g(x)=x.

Example 54: The apparatus according to any one of claims 40 to 53, wherethe chrominance component is adjusted based on the following formulas:

C_(b)^(′) = C_(b) ⋅ S; andC_(r)^(′) = C_(r) ⋅ S,

where

C_(b), C_(r) are chrominance components before the color signal isadjusted, and C_(b)′, C_(r)′ are chrominance components after the colorsignal is adjusted.

Example 55: A picture processing device, including: a non-volatilememory and a processor that are coupled to each other, where theprocessor invokes program code stored in the memory, to perform themethod according to any one of Examples 1 to 11 and Examples 23 to 38.

Example 56: A computer-readable storage medium, where thecomputer-readable storage medium stores a computer program, and when thecomputer program is run on a processor, the method according to any oneof Examples 1 to 11 and Examples 23 to 38 is implemented.

It should be understood that, the processor mentioned in embodiments ofthis application may be a central processing unit (CPU), or may beanother general-purpose processor, a digital signal processor (DSP), anapplication-specific integrated circuit (ASIC), or a field programmablegate array (FPGA), or another programmable logic device, discrete gate,transistor logic device, discrete hardware component, or the like. Thegeneral-purpose processor may be a microprocessor, or the processor maybe any conventional processor or the like.

It may be understood that the memory mentioned in embodiments of thisapplication may be a volatile memory or a non-volatile memory, or mayinclude both a volatile memory and a non-volatile memory. Thenon-volatile memory may be a read-only memory (ROM), a programmableread-only memory (PROM), an erasable programmable read-only memory(EPROM), an electrically erasable programmable read-only memory (EPROM),or a flash memory. The volatile memory may be a random access memory(RAM), used as an external cache. By way of example rather thanlimitation, many forms of RAMs may be used, for example, a static randomaccess memory (SRAM), a dynamic random access memory (DRAM), asynchronous dynamic random access memory (SDRAM), a double data ratesynchronous dynamic random access memory (DDR SDRAM), an enhancedsynchronous dynamic random access memory (ESDRAM), a synchronous linkdynamic random access memory (SLDRAM), and a direct rambus dynamicrandom access memory (DR RAM).

It should be noted that the memory described in this disclosure includesbut is not limited to these memories and any memory of another propertype.

It should be further understood that various numbers such as first andthe second in this disclosure are merely used for differentiation forease of description, and are not construed as a limitation on the scopeof this application.

In this application, “and/or” describes an association relationshipbetween associated objects, and indicates that three relationships mayexist. For example, A and/or B may indicate the following three cases:Only A exists, both A and B exist, and only B exists, where A and B maybe singular or plural. The character “/” generally indicates an “or”relationship between the associated objects.

In this application, “at least one” means one or more, and “a pluralityof” means two or more. “At least one of the following items (pieces)” ora similar expression thereof is any combination of these items,including any combination of singular items (pieces) or plural items(pieces). For example, “at least one of a, b, or c”, or “at least one ofa, b, and c” may indicate: a, b, c, a-b (namely, a and b), a-c, b-c, ora-b-c, where a, b, and c may be singular or plural.

It should be understood that sequence numbers of the foregoing processesdo not mean execution sequences in various embodiments of thisapplication. Some or all of the operations may be performed in parallelor in sequence. The execution sequences of the processes should bedetermined based on functions and internal logic of the processes, andshould not be construed as any limitation on the implementationprocesses of embodiments of this application.

A person of ordinary skill in the art may be aware that units andalgorithm operations in the examples described with reference toembodiments disclosed in this disclosure may be implemented byelectronic hardware or a combination of computer software and electronichardware. Whether the functions are performed by hardware or softwaredepends on particular applications and design constraint conditions ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions of each particularapplication, but it should not be considered that the implementationgoes beyond the scope of this application.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments. Details arenot described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, the unit division ismerely logical function division and may be other division in actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented through some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or other forms.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected depending onactual requirements to achieve the objectives of the solutions in theembodiments.

In addition, function units in embodiments of this application may beintegrated into one processing unit, each of the units may exist alonephysically, or two or more units are integrated into one unit.

When the functions are implemented in the form of a software functionunit and sold or used as an independent product, the functions may bestored in a computer-readable storage medium. Based on such anunderstanding, the technical solutions of this application essentially,or the part contributing to the conventional technology, or some of thetechnical solutions may be implemented in a form of a software product.The computer software product is stored in a storage medium, andincludes several instructions for instructing a computer device (whichmay be a personal computer, a server, a network device, a terminaldevice, or the like) to perform all or some of the operations of themethods in the embodiments of this application. The foregoing storagemedium includes various media that can store program code, for example,a USB flash drive, a removable hard disk, a read-only memory (Read-OnlyMemory, ROM), a random access memory (Random Access Memory, RAM), amagnetic disk, and an optical disc.

Related parts between the method embodiments of this application may bemutually referenced; and apparatuses provided in the apparatusembodiments are configured to perform the methods provided incorresponding method embodiments. Therefore, the apparatus embodimentsmay be understood with reference to related parts in the related methodembodiments.

The diagrams of the structures of the apparatuses provided in theapparatus embodiments of this application show only simplified designsof corresponding apparatuses. In actual application, the apparatus mayinclude any quantity of transmitters, receivers, processors, memories,and the like, to implement functions or operations performed by theapparatus in the apparatus embodiments of this application, and allapparatuses that can implement this application fall within theprotection scope of this application.

Names of messages/frames/indication information, modules, units, or thelike provided in embodiments of this application are merely examples,and other names may be used provided that the messages/frames/indicationinformation, modules, units, or the like have same functions.

The terms used in embodiments of this application are merely for thepurpose of illustrating embodiments, and are not intended to limit thepresent disclosure. The terms “a”, “the” and “this” of singular formsused in embodiments and the appended claims of this application are alsointended to include plural forms, unless otherwise specified in thecontext clearly. It should also be understood that, the term “and/or”used herein indicates and includes any or all possible combinations ofone or more associated listed items. The character “/” in thisdisclosure generally indicates an “or” relationship between theassociated objects. If the character “/” appears in a formula involvedin this disclosure, the character usually indicates that in the formula,an object appearing before the “/” is divided by an object appearingafter the “/”. If the character “{circumflex over ( )}” appears in aformula involved in this disclosure, it generally indicates amathematical power operation.

Depending on the context, for example, the word “if” used herein may beexplained as “while”, “when”, “in response to determining”, or “inresponse to detection”. Similarly, depending on the context, the phrase“if determining” or “if detecting (a stated condition or event)” may beexplained as “when determining”, “in response to determining”, “whendetecting (the stated condition or event)”, or “in response to detecting(the stated condition or event)”.

A person of ordinary skill in the art may understand that all or some ofthe operations of the method in any foregoing embodiment may beimplemented by a program instructing related hardware. The program maybe stored in a readable storage medium of a device, such as a flash oran EEPROM. When the program is run, all or some of the operationsdescribed above are included.

The objectives, technical solutions, and beneficial effects of thepresent disclosure are further described in detail in the foregoingimplementations. It may be understood that the foregoing embodiments areexamples and cannot be construed as a limitation on the presentdisclosure. A person of ordinary skill in the art may make variations,modifications, substitutions, and transformations of the foregoingembodiments within the scope of the present disclosure.

1. A chrominance adjustment method, comprising: determining a coloradjustment coefficient of a chrominance component of a color signalbased on at least one of a reference display device maximum luminancevalue (RML) or a source maximum luminance value (SML); and adjusting thechrominance component of the color signal based on the color adjustmentcoefficient.
 2. The method according to claim 1, wherein the coloradjustment coefficient is determined based on the following formula:$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$ wherein S is the color adjustment coefficient, Ais an adjustment range coefficient, B is a strength range coefficient,C2 is a second correction strength factor, Y_(in) is a luminancecomponent value of the color signal, f(x) is a monotonically increasingfunction when x is in an interval 0 to 1, and SatR1 is a firstsaturation adjustment coefficient.
 3. The method according to claim 1,wherein the color adjustment coefficient is determined based on thefollowing formula: $S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)}}}\ ,}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$ wherein S is the color adjustment coefficient, Ais an adjustment range coefficient, B is a strength range coefficient,C2 is a second correction strength factor, Y_(in) is a luminancecomponent value of the color signal, and SatR1 is a first saturationadjustment coefficient.
 4. The method according to claim 1, wherein thecolor adjustment coefficient is determined based on the followingformula: $S = \left\{ {\begin{matrix}\begin{matrix}{B - {C\; 2 \times {SatR}\; 1 \times}} \\{{f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)},}\end{matrix} & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{\begin{matrix}{B - {C\; 2 \times {SatR}\; 1} - {C\; 2 \times}} \\{{{SatR}\; 2 \times {g\left( \frac{\left( {Y_{in} - {RML}} \right)}{\left( {{SML} - {RML}} \right)} \right)}},}\end{matrix}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$ wherein S is the color adjustment coefficient, Ais an adjustment range coefficient, B is a strength range coefficient,C2 is a second correction strength factor, Y_(in) is a luminancecomponent value of the color signal, f(x) is a monotonically increasingfunction when x is in an interval 0 to 1, and SatR1 is a firstsaturation adjustment coefficient, g(x) is a monotonically increasingfunction when x is in an interval 0 to 1, and SatR2 is a secondsaturation adjustment coefficient.
 5. The method according to claim 4,wherein at least one of RML, SML, A, B, C2, SatR1, and SatR2 isdetermined based on decoded metadata, or is calculated based oninformation carried in the metadata.
 6. The method according to claim 1,wherein the at least one of the RML or the SML is determined based on apreset value, or determined based on the decoded metadata.
 7. The methodaccording to claim 2, wherein A is a preset value, and 0<A≤1.
 8. Themethod according to claim 2, wherein B is a preset value, and 0<B≤1. 9.The method according to claim 2, wherein B is determined based on theSML and a target display device maximum luminance value (TML).
 10. Themethod according to claim 9, wherein B is a ratio of the SML to the TML.11. The method according to claim 2, wherein SatR1 and SatR2 are presetvalues, 0<SatR1≤1, and 0<SatR2≤1.
 12. The method according to claim 11,wherein SatR1+SatR2≤1.
 13. The method according to claim 2, whereinf(x)=x.
 14. The method according to claim 2, wherein f(x)=x^(N), andN>0.
 15. The method according to claim 4, wherein g(x)=x^(M), and M>0.16. The method according to claim 4, wherein g(x)=x.
 17. The methodaccording to claim 2, wherein the chrominance component is adjustedbased on the following formulas: C_(b)^(′) = C_(b) ⋅ S;  andC_(r)^(′) = C_(r) ⋅ S, wherein C_(b), C_(r) are chrominance componentsbefore the color signal is adjusted, and C_(b)′, C_(r)′ are chrominancecomponents after the color signal is adjusted.
 18. A chrominanceadjustment apparatus, comprising: a calculation module, configured todetermine a color adjustment coefficient of a chrominance component of acolor signal based on at least one of a reference display device maximumluminance value (RML) and/or a source maximum luminance value (SML); anda conversion module, configured to adjust the chrominance component ofthe color signal based on the color adjustment coefficient.
 19. Theapparatus according to claim 18, wherein the color adjustmentcoefficient is determined based on the following formula:$S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times {f\left( \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)} \right)}}},}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$ wherein S is the color adjustment coefficient, Ais an adjustment range coefficient, B is a strength range coefficient,C2 is a second correction strength factor, Y_(in) is a luminancecomponent value of the color signal, f(x) is a monotonically increasingfunction when x is in an interval 0 to 1, and SatR1 is a firstsaturation adjustment coefficient.
 20. The apparatus according to claim18, wherein the color adjustment coefficient is determined based on thefollowing formula: $S = \left\{ {\begin{matrix}{{{B - {C\; 2 \times {SatR}\; 1 \times \frac{\left( {Y_{in} - {A \times RML}} \right)}{\left( {{RML} - {A \times RML}} \right)}}}\ ,}\ } & {{R\; M\; L} > Y_{in} > {A \times R\; M\; L}} \\{{{B - {C\; 2 \times {SatR}\; 1}},}\ } & {Y_{in} \geq {R\; M\; L}}\end{matrix},} \right.$ wherein S is the color adjustment coefficient, Ais an adjustment range coefficient, B is a strength range coefficient,C2 is a second correction strength factor, Y_(in) is a luminancecomponent value of the color signal, and SatR1 is a first saturationadjustment coefficient.